package com.vstudy.zx.controller;

import com.vstudy.zx.entity.Article;
import com.vstudy.zx.service.LinkNavService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class LinkNavController {
    @Autowired
    private LinkNavService linkNavService;

    // 暂时推荐文章
    @RequestMapping(value = "/linkNavs", method = RequestMethod.POST)
    @ResponseBody
    public Object linkNavs(Model model) {
        List<Article> articles = linkNavService.topArticles();
        return articles;
    }
}
